<template>
  <div class="dy-main">
    <div class="dy-header">
      <x-header :left-options="{preventGoBack:true}" @on-click-back="back" :right-options="{showMore: false}" @on-click-more="showMenus = true">动账通知详情</x-header>
    </div>
    <div class="dy-body">
      <cell title="账户类型" :value="responseData1.cardType"></cell>
      <cell title="账号/卡号" :value="cardNo"></cell>
      <cell title="手机号码" :value="responseData.mobile"></cell>
      <cell title="短信发送起点金额" :value="responseData.amt"></cell>
      <cell title="短信发送起点时间" :value="responseData.beginTime"></cell>
      <cell title="短信发送结束时间" :value="responseData.endTime"></cell>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      cardNo: '',
      responseData: {
        mobile: '', // 手机号
        amt: '1', // 短信发送起点金额
        beginTime: '', // 短信发送起点时间
        endTime: '' // 短信发送结束时间
      },
      responseData1: {
        cardType: '', // 卡类型
        cardName: '' // 卡名
      },
      status: ''
    }
  },
  methods: {
    back () {
      this.$publicFun.goBack(this)
    },
    goNext (a) {
      alert(a)
    },
    // 除卡类型外的数据
    refreshOption () {
      let _this = this
      this.$bridge.callhandler('nativeRequest',
        JSON.stringify({
          'requstSource': 'internetRequest',
          'url': 'mstep.do?act=business',
          'params': { 'method_Name': 'CI004003_6', 'user_Data': _this.responseData }
        }),
        function (response) {
          response = JSON.parse(response)
          if (response.status === 0 || response.status === '0') {
            _this.responseData1 = response.data.data[0]
          } else {
            console.log('fail')
          }
        }
      )
    },
    // 卡类型数据
    getCardType () {
      let _this = this
      this.$bridge.callhandler('nativeRequest',
        JSON.stringify({
          'requstSource': 'internetRequest',
          'url': 'mstep.do?act=business',
          'params': { 'method_Name': 'CI004003_6', 'user_Data': _this.cardNo }
        }),
        function (response) {
          response = JSON.parse(response)
          if (response.status === 0 || response.status === '0') {
            _this.responseData = response.data.data[0]
          } else {
            console.log('fail')
          }
        }
      )
    }
  },
  created () {
    this.cardNo = this.$route.query.cardNo
    this.refreshOption()
    this.getCardType()
  }
}
</script>

<style>
</style>
